import pickle
data = {"YES":1,"NO":0,"Name":"hu","Num":100}
with open("pickle.txt","wb") as f:
    pickle.dump(data,f,protocol=pickle.HIGHEST_PROTOCOL)
print(data)

with open("pickle.txt","rb") as f:
    data_=pickle.load(f)
print(data_)